var React = require('react');
require('./dialog.scss');
var Dialog = React.createClass({
  propTypes: {
    onClose: React.PropTypes.func,
    width: React.PropTypes.any,
    title: React.PropTypes.string,
  },
  getInitialState() {
    return {
      show: true
    }
  },
  componentDidMount() {
  },
  handleClose() {
    var { onClose } = this.props;
    if (onClose) {
      onClose()
    };
  },
  render() {
    var { width, title } = this.props;
    return (<div className="dialog-wrapper">
      <div className="over-layer"></div>
      <div className="dialog-mod" style={{width: width + 'px', marginLeft: -(width/2) + 'px'}}>
        <h5>{title}</h5>
        <div className="close" onClick={this.handleClose}></div>
        <div className="dialog-content">
          {this.props.children}
        </div>
      </div>
    </div>);  
  },
});

module.exports = Dialog;

